#ifndef PATH_NODE_H
#define PATH_NODE_H

#include <cmath>
#include <algorithm>

namespace Engine
{
	class PathNode
	{
	public:
		int m_x, m_y, m_id;
		float m_g, m_h;
		PathNode* m_parent;

	public:
		PathNode() : m_parent(0) {};
		PathNode(int x, int y, int id, PathNode*_parent) :
		m_x(x),
		m_y(y),
		m_id(id),
		m_parent(_parent),
		m_g(0.0f),
		m_h(0.0f) {};

		float GetF() { return (m_g + m_h); }
		float Heuristic(PathNode* endNode)
		{
			float x = (float)(std::fabs((float)this->m_x - endNode->m_x));
			float y = (float)(std::fabs((float)this->m_y - endNode->m_y));

			return std::max(x, y);
		}
	};
}
#endif